package com.blog.backend.controller;

import com.blog.backend.annotation.LoginAnno;
import com.blog.backend.resp.BlogAssessResp;
import com.blog.backend.service.BlogAssessService;
import com.blog.backend.utils.Result;
import com.blog.backend.vo.PageRequest;
import com.blog.backend.vo.PageResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/assess")
public class BlogAssessController {

    @Resource
    private BlogAssessService blogAssessService;

    @PostMapping("/getToDayAssessList")
    @LoginAnno
    public Result<PageResult<BlogAssessResp>> getToDayAssessList(@RequestBody PageRequest request){
        PageResult<BlogAssessResp> resp= blogAssessService.getToDayAssessList(request);
        return Result.success(resp);
    }

    @PostMapping("/getAllAssessList")
    @LoginAnno
    public Result<PageResult<BlogAssessResp>> getAllAssessList(@RequestBody PageRequest request){
        PageResult<BlogAssessResp> resp= blogAssessService.getAllAssessList(request);
        return Result.success(resp);
    }

    @GetMapping("/getAssessDetail")
    @LoginAnno
    public Result<BlogAssessResp> getAssessDetail(@RequestParam String assessId){
        BlogAssessResp resp=blogAssessService.getAssessDetail(assessId);
        return Result.success(resp);
    }
}
